package com.demo03.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller  //会被自动装配
public class HelloController {

    @RequestMapping("/hello") //映射请求，相当于@WebServlet("/hello")
    public String hello(Model model) {

        model.addAttribute("msg", "hello,springmvcAnnotation");

        return "hello"; //会被视图处理器处理
    }
}
